<template>
  <!-- 首页快捷入口 -->
  <div class="app-container home">
    <div class="title">
      <p>HI,</p>
      欢迎回来
    </div>
    <!-- 快捷方式入口 -->
    <div class="list">
      <div
        class="item"
        v-for="(item, index) in quickList"
        @click="handleRouter(item, index)"
        :key="index"
      >
        <img src="../assets/images/ceshi.png" alt="" />
        <span>{{ item.quickName }}</span>
      </div>
      <!-- <div class="item">
        <img src="../assets/images/adds.png" alt="编辑快捷方式" />
        <span>编辑快捷方式</span>
      </div> -->
    </div>
  </div>
</template>

<script>
import { getQuick } from "@/api/index";
export default {
  data() {
    return {
      quickList: [], //快捷方式入口
    };
  },
  mounted() {
    this.getQuickList();
  },
  methods: {
    getQuickList() {
      getQuick().then((res) => {
        // console.log(res);
        this.quickList = res.rows;
      });
    },
    handleRouter(item, index) {
      if (index == 0) {
        this.$router.push({ path: "/sale/order" });
      } else if (index == 1) {
         this.$router.push({ path: "/sale/ordersStatistics" });
      } else if (index == 2) {
           this.$router.push({ path: "/commodity/goods" });
      }
    },
  },
};
</script>

<style scoped lang="scss">
.app-container {
  .list {
    display: flex;
    justify-content: center;
    padding: 0 80px;
    padding-right: 60px;
    padding-top: 93px;
    flex-wrap: wrap;
    .item {
      cursor: pointer;
      margin-top: 20px;
      padding: 0 40px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: space-around;
      img {
        width: 120px;
        height: 120px;
        border-radius: 50%;
        margin-bottom: 25px;
      }
      span {
        font-size: 16px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: #000000;
      }
    }
  }
  .title {
    // width: 100%;
    // margin-left: 531px;
    // text-align: center;
    display: flex;
    justify-content: center;
    margin-top: 139px;
    font-size: 68px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #000000;
    line-height: 24px;
    display: flex;
    p {
      font-size: 100px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      color: #000000;
      line-height: 24px;
      margin-right: 30px;
    }
  }
}
</style>

